{include file="public/cate" /}
<div class="layui-container">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            {if condition = 'empty($where)'}
            <div class="fly-panel">
                <div class="fly-panel-title fly-filter">
                    <a>置顶</a>
                    <a href="#signin" class="layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin" style="color: #FF5722;">去签到</a></div>
                 <ul class="fly-list">
                    {volist name='top' id='row'}
                        <li>
                            <a href="{:url('index/user/index',['uid'=>$row['uid']])}" class="fly-avatar">
                                <img src="__root__{$row.face}" alt="江景海蓝"></a>
                            <h2>
                                <a class="layui-badge">{$row.cname}</a>
                                <a href="{:url('index/tie/index',['qid'=>$row['qid']])}">{$row.title}</a></h2>
                            <div class="fly-list-info">
                                <a href="/u/10865904" link>
                                    <cite>{$row.nickname}</cite></a>
                                <span>{:Ftime($row.ctime)}分钟前</span>
                                <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻">
                                    <i class="iconfont icon-kiss"></i>{$row.kiss}</span>
                                <span class="fly-list-nums">
                                    <i class="iconfont icon-pinglun1" title="回答"></i>{$row.replay}</span>
                            </div>
                            <div class="fly-list-badge"></div>
                        </li>
                    {/volist}
                </ul>
            </div>
            {/if}
            <div class="fly-panel" style="margin-bottom: 0;">
                <div class="fly-panel-title fly-filter">
                    <a href="{:url('index/index/index',$category)}" class="layui-this">综合</a>
                    <span class="fly-mid"></span>
                    <a href="{:url('index/index/index',array_merge(['status'=>'0'],$category))}">未结</a>
                    <span class="fly-mid"></span>
                    <a href="{:url('index/index/index',array_merge(['status'=>'1'],$category))}">已结</a>
                    <span class="fly-mid"></span>
                    <a href="{:url('index/index/index',array_merge(['status'=>'2'],$category))}">精华</a></div>
                    <ul class="fly-list">
                        {volist name='allTie' id='row'}
                        <li>
                            <a href="{:url('index/user/index',['uid'=>$row['uid']])}" class="fly-avatar">
                                <img src="__root__{$row.face}" alt="江景海蓝"></a>
                            <h2>
                                <a class="layui-badge">{$row.cname}</a>
                                <a href="{:url('index/tie/index',['qid'=>$row['qid'],'aid'=>90])}">{$row.title}</a></h2>
                            <div class="fly-list-info">
                                <a href="/u/10865904" link>
                                    <cite>{$row.nickname}</cite></a>
                                <span>{:Ftime($row.ctime)}分钟前</span>
                                <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻">
                                    <i class="iconfont icon-kiss"></i>{$row.kiss}</span>
                                <span class="fly-list-nums">
                                    <i class="iconfont icon-pinglun1" title="回答"></i>{$row.replay}</span>
                            </div>
                            <div class="fly-list-badge">
                                {if condition = '$row.is_jing'}
                                <span class="layui-badge layui-bg-red">精帖</span>
                                {/if}
                            </div>
                        </li>
                        {/volist}
                    </ul>  
                <style type="text/css">
                   .pagination{

                   }
                   .pagination li{
                        display: inline-block;
                        padding: 5px 10px;
                        border: 1px solid #009587;
                        margin: 0 5px;
                        cursor: pointer;
                        
                   }
                   .pagination li.active{
                        background: #009587;
                        color: #fff;

                   }
                </style> 
                <div style="text-align: center">
                    <!-- <div class="laypage-main">
                        <a href="/column/all/page/2/" class="laypage-next">更多求解</a></div> -->
                    {$allTie->render()}
                </div>
            </div>
        </div>
        <div class="layui-col-md4">
            <div class="fly-panel">
                <h3 class="fly-panel-title">温馨通道</h3>
                <ul class="fly-panel-main fly-list-static">
                    <li>
                        <a name="signin"></a>
                        <a href="http://fly.layui.com/case/2018/" target="_blank">layui 案例平台，发现更广泛的生态</a></li>
                    <li>
                        <a href="http://fly.layui.com/jie/4281/" target="_blank">layui 的 GitHub 及 Gitee (码云) 仓库，欢迎Star</a></li>
                    <li>
                        <a href="http://fly.layui.com/jie/5366/" target="_blank">layui 常见问题的处理和实用干货集锦</a></li>
                    <li>
                        <a href="http://fly.layui.com/jie/13435/" target="_blank">关于 Fly 社区飞吻的消耗与增加</a></li>
                    <li>
                        <a href="http://www.layui.com/template/fly/" target="_blank">下载“Fly社区”页面模板：Fly Template</a></li>
                </ul>
            </div>
            <div class="fly-panel fly-signin">
                <div class="fly-panel-title">签到
                    <i class="fly-mid"></i>
                    <a href="javascript:;" class="fly-link" id="LAY_signinHelp">说明</a>
                    <i class="fly-mid"></i>
                    <a href="javascript:;" class="fly-link" id="LAY_signinTop">活跃榜
                        <span class="layui-badge-dot"></span></a>
                    {if condition='$signInfo'}
                    <span class="fly-signin-days">已连续签到<cite id='day'>{$signInfo.num}</cite>天</span>
                    {/if}
                </div>
                <div class="fly-panel-main fly-signin-main">

                    {if condition='$signInfo && $signInfo.today'}
                    <button class="layui-btn layui-btn-disabled">今日已签到</button>
                    {else/}
                    <button class="layui-btn layui-btn-danger" id="LAY_signin">今日签到</button>
                    {/if}
                    {if condition='$signInfo'}
                    <span>可获得<cite>{$signInfo.kiss}</cite>飞吻</span>
                    {/if}
                </div>
            </div>
            <div class="fly-panel">
                <div class="fly-panel-title">钻级赞助商
                    <span class="fly-mid"></span>
                    <a href="/jie/15697/" class="fly-link fly-joinad    ">我要加入</a></div>
                <div class="fly-panel-main" style="padding: 13px 15px;">
                    <a href="http://www.ukewo.cn/" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #1A7BFA;" time-limit="2018-05-13 0:0:0">优客服 - 开源的智能客服系统 + 呼叫中心</a>
                    <a href="https://juejin.im/welcome/backend?utm_source=layui&utm_medium=banner&utm_content=fangwen&utm_campaign=q2_website" target="_blank" rel="nofollow" class="fly-zanzhu fly-zanzhu-img" time-limit="2018-05-20 0:0:0">
                        <img src="//cdn.layui.com/upload/2018_4/168_1524128314283_57388.jpg" alt="掘金"></a>
                </div>
            </div>
            <div class="fly-panel fly-rank fly-rank-reply" id="LAY_replyRank">
                <h3 class="fly-panel-title">回贴周榜</h3>
                <dl>
                    {volist name="hotReplay" id="vo"}
                    <dd>
                        <a href="{:url('index/user/index',['uid'=>$vo['uid']])}">
                            <img src="__root__{$vo.face}">
                            <cite>{$vo.nickname}</cite>
                            <i>{$vo.cn}次回答</i>
                        </a>
                    </dd>
                    {/volist}
                </dl>
            </div>
            {include file="public/weekHot" /}
            <div class="fly-panel">
                <div class="fly-panel-title">官方产品</div>
                <div class="fly-panel-main">
                    <a href="http://www.layui.com/admin/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #20222A;">layuiAdmin - layui 官方后台管理模板</a>
                    <a href="http://layim.layui.com/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #009688;">LayIM - layui 即时通讯旗舰之作</a></div>
            </div>
            <div class="fly-panel" style="padding: 20px 0; text-align: center;">
                <img src="//cdn.layui.com/upload/2017_8/168_1501894831075_19619.jpg" style="max-width: 100%;" alt="layui">
                <p style="position: relative; color: #666;">微信扫码关注 layui 公众号</p></div>
            <div class="fly-panel fly-link">
                <h3 class="fly-panel-title">友情链接</h3>
              
            </div>
        </div>
    </div>
</div>
<script>
    //Demo
    layui.use(['form','jquery'], function(){
      var form = layui.form;
      $ = layui.jquery;

      $.get('{:url('index/index/getcate')}', function(data) {
          console.log(data);
      });

      $('#LAY_signin').click(function (argument) {

            $.ajax({
                url: '{:url('index/index/sign')}',
                type: 'GET',
                dataType: 'json'
            })
            .done(function(res) {
               if (res.code==0) {
                    layer.msg(res.msg,function(){});
               }else{
                    $('#LAY_signin').removeClass('layui-btn-danger');
                    $('#LAY_signin').addClass('layui-btn-disabled');
                    $('#LAY_signin').html('今日已签到');
                    $('#day').html(Number($('#day').html())+1);
                    layer.msg(res.msg,function(){

                    });
               }
            })
            .fail(function() {
                layer.msg('系统异常',function(){});
            })
      })
    });
    </script>